package com.dianping.cat.alarm.rule.entity;

import com.dianping.cat.alarm.rule.BaseEntity;
import com.dianping.cat.alarm.rule.IVisitor;
import java.util.LinkedHashMap;
import java.util.Map;

public class MonitorRules
  extends BaseEntity<MonitorRules> {
/* 10 */   private Map<String, Rule> m_rules = new LinkedHashMap();






/* 17 */   public void accept(IVisitor visitor) { visitor.visitMonitorRules(this); }


  public MonitorRules addRule(Rule rule) {
/* 21 */     this.m_rules.put(rule.getId(), rule);
/* 22 */     return this;
  }


  public boolean equals(Object obj) {
/* 27 */     if (obj instanceof MonitorRules) {
/* 28 */       MonitorRules _o = (MonitorRules)obj;

/* 30 */       if (!equals(getRules(), _o.getRules())) {
/* 31 */         return false;
      }


/* 35 */       return true;
    }

/* 38 */     return false;
  }


/* 42 */   public Rule findRule(String id) { return (Rule)this.m_rules.get(id); }


  public Rule findOrCreateRule(String id) {
/* 46 */     Rule rule = (Rule)this.m_rules.get(id);

/* 48 */     if (rule == null) {
/* 49 */       synchronized (this.m_rules) {
/* 50 */         rule = (Rule)this.m_rules.get(id);

/* 52 */         if (rule == null) {
/* 53 */           rule = new Rule(id);
/* 54 */           this.m_rules.put(id, rule);
        }
      }
    }

/* 59 */     return rule;
  }


/* 63 */   public Map<String, Rule> getRules() { return this.m_rules; }





  public void mergeAttributes(MonitorRules other) {}



/* 80 */   public Rule removeRule(String id) { return (Rule)this.m_rules.remove(id); }
}


/* Location:              /Users/hanfei/Documents/apache-tomcat-9.0.24/webapps/cat/WEB-INF/lib/cat-alarm-3.0.0.jar!/com/dianping/cat/alarm/rule/entity/MonitorRules.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       1.0.7
 */